﻿using FoodModel;
using J.FoodManageGet.Application.Command.DishesCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.DishesCommandHandler
{
    /// <summary>
    /// 菜品反填
    /// </summary>
    public class DishesBackCommandHandler : IRequestHandler<DishesBackCommand, DishesModel>
    {
        private readonly IDishesReposittory _dishesReposittory;

        public DishesBackCommandHandler(IDishesReposittory dishesReposittory)
        {
            _dishesReposittory = dishesReposittory;
        }
        public async Task<DishesModel> Handle(DishesBackCommand request, CancellationToken cancellationToken)
        {
            return await _dishesReposittory.DishesBack(request.DishId);
        }
    }
}
